package br.com.seosoft.simplecalcfinan.adapters;

import java.util.List;

import br.com.seosoft.simplecalcfinan.R;
import br.com.seosoft.simplecalcfinan.geral;
import br.com.seosoft.simplecalcfinan.R.layout;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckedTextView;
import android.widget.TextView;

public class AdapterPasta extends BaseAdapter {

	private Context context;
	private List<geral> geralList;

	public AdapterPasta(Context context, List<geral> geralList) {
		this.context = context;
		this.geralList = geralList;
	}

	@Override
	public int getCount() {
		return geralList.size();
	}

	@Override
	public Object getItem(int position) {
		return geralList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		geral geral = geralList.get(position);

		
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

		
		 View view = inflater.inflate(R.layout.spinner, null);
		
		 // nome da pasta
		 TextView pasta = (TextView) view
		 .findViewById(android.R.id.text1);
		
		 pasta.setText(geral.getDescGrupo());

		return view;
	}

}
